/*
 * Copyright (c) 2013-2015 Charkey. All rights reserved.
 *
 * This software is the confidential and proprietary information of Charkey.
 * You shall not disclose such Confidential Information and shall use it only
 * in accordance with the terms of the agreements you entered into with Charkey.
 *
 * Charkey MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
 *
 * Charkey SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
 * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
 */

package cn.simastudio.talos.inter.mapper.inst;

import cn.simastudio.talos.inter.model.inst.Member;

import java.util.List;

/**
 * Usage: Mapper会员；书店默认也是会员
 *
 * @author Charkey
 * @date 2015/5/20 11:46
 */
public interface MemberMapper {

    /**
     * 根据会员记录ID删除会员记录
     *
     * @param id 会员记录ID
     * @return 1：删除成功；0：删除失败；
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * 新增会员数据
     *
     * @param member 待新增会员对象
     * @return 1：新增成功；0：新增失败；
     */
    int insertSelective(Member member);

    /**
     * 通过会员记录ID查找信息
     *
     * @param id 会员记录ID
     * @return 会员对象Member
     */
    Member selectByPrimaryKey(Integer id);

    /**
     * 更新会员对象信息
     *
     * @param member 待更新的Member会员对象
     * @return 1：更新成功；0：更新失败；
     */
    int updateByPrimaryKeySelective(Member member);

    /**
     * 通过会员名查找会员信息，返回会员对象
     *
     * @param name 会员名
     * @return 会员对象Member
     */
    Member getMemberByUsername(String username);

    /**
     * 通过会员注册手机号查找会员信息，返回会员对象
     *
     * @param tel 会员名
     * @return 会员对象Member
     */
    Member getMemberByTel(String tel);

    /**
     * 查询会员列表（姓名、id）
     *
     * @param member 会员对象Member
     * @return 会员对象列表
     */
    List<Member> getMemberListLikeUsername(Member member);

}